<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>http::is_body_reader</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Chapter 1. Boost.Beast">
<link rel="up" href="../ref.html" title="This Page Intentionally Left Blank 2/2">
<link rel="prev" href="boost__beast__http__is_mutable_body_writer.html" title="http::is_mutable_body_writer">
<link rel="next" href="boost__beast__http__is_fields.html" title="http::is_fields">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="boost__beast__http__is_mutable_body_writer.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost__beast__http__is_fields.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="beast.ref.boost__beast__http__is_body_reader"></a><a class="link" href="boost__beast__http__is_body_reader.html" title="http::is_body_reader">http::is_body_reader</a>
</h4></div></div></div>
<p>
        <a class="indexterm" name="idm77518"></a>
      </p>
<p>
        Determine if a type has a nested <span class="emphasis"><em>BodyReader</em></span>.
      </p>
<h5>
<a name="beast.ref.boost__beast__http__is_body_reader.h0"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__http__is_body_reader.synopsis"></a></span><a class="link" href="boost__beast__http__is_body_reader.html#beast.ref.boost__beast__http__is_body_reader.synopsis">Synopsis</a>
      </h5>
<p>
        Defined in header <code class="literal">&lt;<a href="../../../../../../boost/beast/http/type_traits.hpp" target="_top">boost/beast/http/type_traits.hpp</a>&gt;</code>
      </p>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span>
    <span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
<span class="keyword">using</span> <span class="identifier">is_body_reader</span> <span class="special">=</span> <span class="emphasis"><em>see-below</em></span><span class="special">;</span>
</pre>
<h5>
<a name="beast.ref.boost__beast__http__is_body_reader.h1"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__http__is_body_reader.description"></a></span><a class="link" href="boost__beast__http__is_body_reader.html#beast.ref.boost__beast__http__is_body_reader.description">Description</a>
      </h5>
<p>
        This alias template is <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">true_type</span></code>
        when:
      </p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
            <code class="computeroutput"><span class="identifier">T</span></code> has a nested type named
            <code class="computeroutput"><span class="identifier">reader</span></code>
          </li>
<li class="listitem">
            <code class="computeroutput"><span class="identifier">reader</span></code> meets the requirements
            of <span class="emphasis"><em>BodyReader</em></span>.
          </li>
</ul></div>
<h5>
<a name="beast.ref.boost__beast__http__is_body_reader.h2"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__http__is_body_reader.template_parameters"></a></span><a class="link" href="boost__beast__http__is_body_reader.html#beast.ref.boost__beast__http__is_body_reader.template_parameters">Template
        Parameters</a>
      </h5>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
                <p>
                  Type
                </p>
              </th>
<th>
                <p>
                  Description
                </p>
              </th>
</tr></thead>
<tbody><tr>
<td>
                <p>
                  <code class="computeroutput"><span class="identifier">T</span></code>
                </p>
              </td>
<td>
                <p>
                  The body type to test.
                </p>
              </td>
</tr></tbody>
</table></div>
<h5>
<a name="beast.ref.boost__beast__http__is_body_reader.h3"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__http__is_body_reader.example"></a></span><a class="link" href="boost__beast__http__is_body_reader.html#beast.ref.boost__beast__http__is_body_reader.example">Example</a>
      </h5>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">bool</span> <span class="identifier">isRequest</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Body</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Fields</span><span class="special">&gt;</span>
<span class="keyword">void</span> <span class="identifier">check_can_parse</span><span class="special">(</span><span class="identifier">message</span><span class="special">&lt;</span><span class="identifier">isRequest</span><span class="special">,</span> <span class="identifier">Body</span><span class="special">,</span> <span class="identifier">Fields</span><span class="special">&gt;&amp;)</span>
<span class="special">{</span>
    <span class="keyword">static_assert</span><span class="special">(</span><span class="identifier">is_body_reader</span><span class="special">&lt;</span><span class="identifier">Body</span><span class="special">&gt;::</span><span class="identifier">value</span><span class="special">,</span>
        <span class="string">"Cannot parse Body, no reader"</span><span class="special">);</span>
<span class="special">}</span>
</pre>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Vinnie
      Falco<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="boost__beast__http__is_mutable_body_writer.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost__beast__http__is_fields.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
